package com.eqdd.yiqidian.ui;

import com.eqdd.yiqidian.base.BaseActivity;

/**
 * @author吕志豪 .
 * @date 18-3-1  下午2:18.
 * Github :https://github.com/lvzhihao100
 * E-Mail：1030753080@qq.com
 * 简书 :http://www.jianshu.com/u/6e525b929aac
 */

public class YoukuPlayActivity extends BaseActivity {
    @Override
    public void initBinding() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void setView() {

    }

   /* private YoukuPlayActivityCustom dataBinding;
    private String vid;

    @Override
    public void initBinding() {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.app_activity_youku_play);
    }

    @Override
    public void initData() {
        String url = getIntent().getStringExtra(Config.URL);
        String content = getIntent().getStringExtra(Config.CONTENT);
        if (url != null) {
            Logger.d(url);
            Pattern compile = Pattern.compile(".*(\\w{15}==)");
            Matcher matcher = compile.matcher(url);
            if (matcher.find()) {
                if (matcher.groupCount() > 0) {
                    vid = matcher.group(1);
                    Logger.d(vid);
                }
            }
            Logger.d(matcher.group(0));
            Logger.d(matcher.group(1));
        }
        // 初始化播放器
        dataBinding.youkuPlay.attachActivity(this);
        dataBinding.youkuPlay.setPreferVideoDefinition(VideoDefinition.VIDEO_HD);
        dataBinding.youkuPlay.setPlayerListener(new PlayerListener() {

        });
        dataBinding.youkuPlay.playYoukuVideo(vid);
        dataBinding.youkuPlay.goFullScreen();
        dataBinding.tvContent.setText(content);


    }

    @Override
    public void setView() {
    }

    @Override
    protected void onPause() {
        super.onPause();
        // 必须重写的onPause()
        dataBinding.youkuPlay.onPause();
    }

    @Override
    protected void onResume() {
        super.onResume();
        // 必须重写的onResume()
        dataBinding.youkuPlay.onResume();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        // 必须重写的onDestroy()
        dataBinding.youkuPlay.onDestroy();
    }*/
}
